﻿// Bing Maps ASP.NEt Control is a community project available under the Microsoft Public License (Ms-PL)
// Code is provided as is and with no warrenty – Use at your own risk
// View the project and the latest code at http://BingMapsASP.codeplex.com

using System.Collections.Generic;
using System.Web.Script.Serialization;

namespace Microsoft.Live.ServerControls.VE.ControllerLogic
{
    internal class ActionController
    {
        public List<Action> Actions { get; set; }

        public ActionController()
        {
            Actions = new List<Action>();
        }

        public void AddAction(Action action)
        {
            Actions.Add(action);
        }

        public string GetJSON()
        {
            if (Actions.Count > 0)
            {
                JavaScriptSerializer jss = new JavaScriptSerializer();
                return jss.Serialize(Actions);
            }else
            {
                return "";
            }
        }
    }
}
